﻿
namespace Patterns4Net.Core
{
    using System;
    using Mono.Cecil;

    /// <summary>
    /// This Exception should be base class of all exceptions caused by Cecil's Resolve method.
    /// </summary>
    public class ResolveException : ApplicationException
    {
        public ResolveException(MemberReference member, string message = "", Exception inner = null)
            : base(message, inner)
        {
            this.Member = member;
        }

        public ResolveException(MemberReference member, Exception inner = null)
            : base("", inner)
        {
            this.Member = member;
        }

        /// <summary>
        /// The member whose resolving caused the exception.
        /// </summary>
        public MemberReference Member { get; set; }
    }
}
